<template>
  <div id="seven">
    <!-- <button @click="handle">变</button> -->
    <div class="contain" :class="{'change-contain': isShow}">
      <span class="icon-one" :class="{'change-icon_one': isShow}">111</span>
      <span class="icon-two" :class="{'change-icon_two': isShow}">222</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'seven',
  props: {
    isShow: Boolean,
    default: false
  },
  data () {
    return {
      // isShow: false
    }
  },
  methods: {
    // handle () {
    //   this.isShow = !this.isShow
    // }
  },


}
</script>

<style lang="scss" scoped>
#seven {
  width: 400px;
  height: 400px;
  position: relative;
  border: 1px solid black;
}
.contain {
  width: 100px;
  height: 100px;
  background: red;
  position: absolute;
  right: 0;
  top: 50px;
  // display: flex;
  // justify-content: flex-end;
  transition: width .3s;
  span {
    position: absolute;
    right: 0;
    box-sizing: border-box;
    display: inline-block;
    width: 100px;
    height: 100px;
    background: yellowgreen;
  }
  .icon-one {
    background: violet;
    opacity: 0;
    // transition: opacity .2s;
  }
  .change-icon_one {
    opacity: 1;
    transition: opacity .2s;
  }
  .icon-two {
    border: 1px solid black;
    transition: opacity .2s;
  }
  .change-icon_two {
    opacity: 0;
  }
}
.change-contain {
  width: 300px;
  transition: width .3s;
}
</style>